package org.example.TankGan.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author cc
 * @date 2021/4/19 16:57
 * @Description 爆炸类
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Boom {
    int x ,y;
    int life = 10;
    boolean isLive = true;

    public Boom(int x, int y) {
        this.x = x;
        this.y = y;
    }
    //减少生命周期
    public void reduceLive(){
        if (life>0){
            life--;
        }else {
            isLive =false;
        }
    }
}
